package application.caiji;

import java.util.HashMap;
import java.util.Map;

import org.junit.Test;

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;

import application.caiji.dao.dal_sql;
import newcontent.http.HttpClientUtil;

public class maintest {
	public static void main(String[] args) throws InterruptedException {
		System.out.println("开始...");
		String yuming1="http://localhost:8080/datacollect/";
		String yuming2="http://datacollect.cnbkw.com:8088/";
		String yufaing="http://test.datacollect.cnbkw.com:8083/";
		String yufa="http://yufa.datacollect.cnbkw.com:8083/";
		dal_sql dal_sql=new dal_sql();
		//推广
//		String updatesql1="update tuiguang_temporary set pt='20200101', pagesize=0,pagenum=-1 where id=85;";
		String updatesql2="update tuiguang_temporary set pt='20170101', pagesize=0,pagenum=-1 where id=86;";
		String updatesql3="update tuiguang_temporary set pt='20200310', pagesize=0,pagenum=-1 where id=87;";
		String updatesql4="update tuiguang_temporary set pt='20200320', pagesize=0,pagenum=-1 where id=88;";
		//100000,|app 8:13800.00,app 9:234455.70
		String select="SELECT COUNt(*) FROM bkw_Node -- top";
		String select2="select * from node where nodeid=33345";
		
		Map<String,String> map =new HashMap<String, String>();
		map.put("string", "tonxing_:"+select2);
		//select,update
		String type="select";
		map.put("type", type);
//		map.put("size", "100");
		//bkw_question_article,bkw_data
		//thuiguang,orderanalysis,bkw_studypaper,appthuiguang
		//oaandcrm,examsys
		//yitiku,weixinfenxiang,mysql,bkw_tiku
		map.put("source", "examsys");
		String results = HttpClientUtil.doPost(yufa+"tuiGuangPromotionDataDouyin/stringis/longandlong", map);
		System.out.println(results);
		String ids="";
		if("select".equals(type)){
			JSONArray parseArray = JSONArray.parseArray(results);
			System.out.println("数量:"+parseArray.size());
			for (int i = 0; i < parseArray.size(); i++) {
				JSONObject jsonObject = parseArray.getJSONObject(i);
				System.out.println(jsonObject);
//				ids+="\""+jsonObject.getString("id")+"\",";
			}
//			System.out.println(ids.substring(0, ids.length()-1));
		}else{
			System.out.println(results);
		}
	}
	
	/*
	 * 清除数据接口
	 */
//	@Test
	public void test(){
		//guangdiantonganalysis,promotionExptdouyin
		//ptpromotionanalysis/clearyesterday
		String yuming="http://datacollect.cnbkw.com:8088/";
		String yuming2="http://localhost:8080/datacollect/";
		Map<String,String> map =new HashMap<String, String>();
		map.put("beginDate", "20200227");
		map.put("endDate", "20200304");
//		map.put("exId", "144");
		//extension_pt_promotion_analysis_copy,
		//promotion_campaign_group_analysis_copy,
		//extension_pt_timeinterval_analysis
		map.put("tableName", "extension_pt_promotion_analysis_copy");
		
//		设置生成文章
//		map.put("id", "1");
//		map.put("nextdate", "2020-01-09");
		//generateArticle/setArticleplan
//		String results = HttpClientUtil.doPost(yuming+"guangdiantonganalysis/ptpromotionanalysis/clearyesterday", map);
//		System.out.println(results);
		
	}
	
//	@Test
	public void test2(){
		String yuming="http://datacollect.cnbkw.com:8088/";
		String yuming2="http://localhost:8080/datacollect/";
		Map<String,String> map =new HashMap<String, String>();
		//注册量
//		map.put("restExid", "39");
//		map.put("clienttype", "2");
//		map.put("resetMasterid", "1209");
//		map.put("useridstr", "");
		String results = HttpClientUtil.doPost(yuming+"tuiguangnew/promotioncampaigngroupanalysisreg", map);
		System.out.println(results);
//		int datetime=20190830;
//		int s=datetime;
//		for (int i = 0; i <(20190832-s); i++) {
//			System.out.println(datetime);
//			if(datetime<=20190831){
//				map.put("pt",datetime+"");
//				
//				datetime++;
//			}
//		}
		
	}
	
	@Test
	public void test3(){
		String yuming="http://yufa.datacollect.cnbkw.com:8083/";
		Map<String,String> map =new HashMap<String, String>();
		//注册量
		map.put("userlist", "12798996,12799157,12800866,12801958,12802036,12802055,12802323,12733515,12734224,12735214,12735505,12735773,12737536,12737645,12740359,12765879,12766009,12769203,12769254,12774829,12776889,12777085,12788461,12794510,12795785,12797896,12975080,12986794,12986870,12994076,12995132,12996202,12997933,12967278,13005349,13010971,13013576,13027438,13031158,13064661,13065818,13066818,13070266,13071659,13072473,13073318,13014176,13014422,13015823,13015855,13016912,13017700,13035200,13043837,13147631,13150123,13152252,13152596,13152903,13153164,13155180,13156685,13157936,13158493,13160544,13160873,13162172,13162638,13162801,13175387,13175613,13175624,13180105,13180663,13067439,13068343,13068349,13068903,13186512,13076141,13086883,13086982,13091596,13102394,13103978,13213527,13213770,13215771,13215968,13215972,13216300,13104471,13112466,13112813,13219263,13117596,13120813,13125307,13126755,13135579,13139138,13139475,13141077,13141431,13141474,13219347,13219902,13220214,13220280,13220624,13220904,13220992,13221096,13221353,13221617,13221891,13221974,13222036,13222194,13223327,13224727,13224910,13224965,13225026,13225648,13225979,13228053,13231471,13231576,13231689,13057129,13232206,13232609,13232950,13233210,13233524,13233831,13234062,13234083,13234127,13164801,13169399,13170214,13170766,13170879,13174324,13174882,13174886,13234128,13234645,13235915,13236022,13236063,13236165,13236172,13236245,13236327,13236398,13237035,13237346,13237347,13237701,13238051,13238480,13239431,13239668,13240432,13242187,13242211,13242436,13193011,13242448,13242623,13242647,13242963,13243325,13243519,13243576,13243798,13244182,13244307,13244355,13193676,13245120,13245124,13245146,13245161,13194419,13197569,13200455,13201607,13203314,13203613,13203690,13206168,13207990,13209573,13245773,13245895,13246020,13246224,13246243,13246412,13246740,13246865,13247649,13248871,13209947,13209951,13209988,13210835,13210869,13211596,13249087,13249090,13249747,13211644,13212514,13251165,13217551,13218178,13218321,13218443,13218471,13218762,13218796,13218842,13219055,13219104,13253616,13255184,13255747,13255809,13258055,13259824,13219130,13262925,13264141,13264219,13264232,13264264,13264342,13264761,13271425,13271432,13271461,13274012,13274326,13275048,13276411,13276481,13276737,13276775,13277421,13278806,13279096,13279423,13280780,13281094,13281293,13281983,13282568,13283053,13283195,13283495,13283759,13290975,13291899,13294309,13295359,13295719,13296746,13302477,13234669,13234943,13235323,13306055,13307896,13310104,13310121,13311023,13311211,13311560,13312680,13313514,13313969,13316726,13320407,13321513,13321553,13321554,13321557,13321558,13321560,13321562,13321563,13321851,13321955,13321958,13322353,13322478,13322767,13329087,13329308,13329695,13329913,13330400,13330845,13331134,13331379,13331605,13332066,13332143,13332184,13252349,13253135,13332696,13332834,13333609,13334079,13334671,13335503,13336403,13341757,13264912,13266235,13267633,13268936,13270662,13271709,13272142,13272170,13272230,13272350,13273764,13345110,13346101,13346547,13346557,13347343,13347532,13349475,13350372,13415241,13351712,13284787,13284887,13285822,13287523,13289651,13289681,13290570,13353289,13353318,13353975,13354844,13355853,13356121,13298270,13298478,13298583,13299386,13299393,13300014,13301189,13357571,13357731,13358109,13304067,13415825,13363339,13364131,13364895,13366069,13369553,13369653,13370138,13370247,13374559,13375528,13376380,13376592,13376890,13380263,13381489,13381596,13382979,13382989,13416801,13416817,13386336,13387134,13387179,13323471,13323756,13326979,13327688,13327800,13328067,13328278,13389642,13389813,13390354,13391737,13392181,13393808,13393945,13397840,13399274,13400194,13402541,13402545,13404764,13406221,13406976,13407432,13408529,13409538,13409678,13409713,13409810,13411406,13412005,13412048,13413105,13413430,13414231,13414318,13414379,13414445,13414457,13414467,13414487,13414519,13414521,13414535,13414544,13414549,13414587,13414589,13414590,13414595,13414597,13414602,13414610,13414648,13414660,13414665,13414681,13414721,13414733,13414740,13414793,13414818,13414826,13420485,13414828,13414842,13414857,13414859,13414861,13414868,13414881,13414901,13414913,13414932,13414936,13414940,13415031,13415035,13415038,13415095,13415136,13415140,13415144,13415153,13415159,13415168,13415170,13415174,13415175,13415212,13415215,13415228,13415254,13415265,13415266,13415282,13415304,13415324,13415333,13415357,13415363,13415369,13415410,13415428,13415442,13415472,13415481,13415485,13415499,13415521,13415523,13415549,13415562,13415576,13415619,13415635,13415643,13415646,13415654,13415662,13415679,13415691,13415700,13415726,13415736,13415763,13415765,13415842,13415844,13415860,13427856,13415865,13415882,13415913,13415925,13415955,13416004,13416008,13416046,13416067,13416091,13416150,13416167,13416179,13416194,13416230,13416246,13416262,13416277,13416334,13416350,13416367,13416368,13416382,13416387,13416402,13374288,13374447,13416437,13416478,13416517,13416535,13416601,13416604,13416611,13377398,13377815,13378351,13378525,13416630,13416701,13416727,13416781,13416784,13416790,13416864,13416945,13417075,13417077,13417085,13417127,13417158,13417160,13417209,13417266,13417292,13417305,13417310,13417387,13417456,13417478,13417479,13417481,13417492,13417501,13417509,13417511,13417536,13417620,13417855,13417857,13418069,13418116,13418126,13418333,13418337,13418450,13418971,13418973,13418999,13419007,13419033,13419258,13419467,13419585,13419686,13419718,13419719,13419723,13419744,13419753,13419754,13419755,13419756,13419764,13419767,13419786,13419820,13419842,13419850,13419899,13419904,13419919,13419922,13419924,13419926,13419930,13419936,13419956,13419958,13419964,13419966,13419970,13419980,13419982,13419997,13420004,13420013,13420018,13420026,13420031,13420041,13420065,13420078,13420085,13420106,13420109,13420114,13420152,13420170,13420181,13420186,13420187,13420203,13420389,13420462,13420541,13420617,13420620,13420627,13420656,13420658,13420740,13420741,13420755,13420768,13420777,13420784,13420847,13420870,13420907,13420920,13420975,13420993,13421008,13421052,13421130,13421148,13421382,13421399,13421409,13421441,13421446,13421462,13421564,13421609,13421711,13421728,13421773,13421824,13421838,13421846,13421855,13421919,13422009,13422019,13422032,13422058,13422110,13422126,13422236,13422237,13422467,13422537,13422605,13422614,13422621,13415592,13415602,13422686,13422819,13422822,13422915,13423057,13423072,13423164,13423220,13423234,13423297,13423511,13423561,13423568,13415780,13415788,13415815,13415821,13423576,13415823,13423587,13359383,13423862,13424254");
		String results = HttpClientUtil.doPost(yuming+"tuiguangnew/registerUsertable/reset", map);
		System.out.println(results);
		
	}
}
